<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Transfers a result set from the last query</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.stmt-init.html">mysqli::stmt_init</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.thread-id.html">mysqli::$thread_id</a></div>
 <div class="up"><a href="class.mysqli.html">MySQLi</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mysqli.store-result" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqli::store_result</h1>
  <h1 class="refname">mysqli_store_result</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">mysqli::store_result</span> -- <span class="refname">mysqli_store_result</span> &mdash; <span class="dc-title">Transfers a result set from the last query</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqli.store-result-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="class.mysqli-result.html" class="type mysqli_result">mysqli_result</a></span> <span class="methodname"><strong>mysqli::store_result</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="class.mysqli-result.html" class="type mysqli_result">mysqli_result</a></span> <span class="methodname"><strong>mysqli_store_result</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.mysqli.html" class="type mysqli">mysqli</a></span> <code class="parameter">$link</code></span>
   )</div>

  <p class="para rdfs-comment">
   Transfers the result set from the last query on the database connection
   represented by the <em><code class="parameter">link</code></em> parameter to be used with
   the <span class="function"><a href="mysqli-result.data-seek.html" class="function">mysqli_data_seek()</a></span> function.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysqli.store-result-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<em><code class="parameter">
link</code></em></dt>
<dd>
<p class="para">仅以过程化样式：由<span class="function"><a href="function.mysqli-connect.html" class="function">mysqli_connect()</a></span> 或 <span class="function"><a href="mysqli.init.html" class="function">mysqli_init()</a></span>
返回的链接标识。</p></dd>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mysqli.store-result-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a buffered result object or <strong><code>FALSE</code></strong> if an error occurred.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    <span class="function"><strong>mysqli_store_result()</strong></span> returns <strong><code>FALSE</code></strong> in case the query
    didn&#039;t return a result set (if the query was, for example an INSERT
    statement). This function also returns <strong><code>FALSE</code></strong> if the reading of the
    result set failed. You can check if you have got an error by checking
    if <span class="function"><a href="mysqli.error.html" class="function">mysqli_error()</a></span> doesn&#039;t return an empty string, if
    <span class="function"><a href="mysqli.errno.html" class="function">mysqli_errno()</a></span> returns a non zero value, or if
    <span class="function"><a href="mysqli.field-count.html" class="function">mysqli_field_count()</a></span> returns a non zero value.
    Also possible reason for this function returning <strong><code>FALSE</code></strong> after
    successful call to <span class="function"><a href="mysqli.query.html" class="function">mysqli_query()</a></span> can be too large
    result set (memory for it cannot be allocated). If
    <span class="function"><a href="mysqli.field-count.html" class="function">mysqli_field_count()</a></span> returns a non-zero value, the
    statement should have produced a non-empty result set.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 notes" id="refsect1-mysqli.store-result-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Although it is always good practice to free the memory used by the result
    of a query using the <span class="function"><a href="mysqli-result.free.html" class="function">mysqli_free_result()</a></span> function,
    when transferring large result sets using the 
    <span class="function"><strong>mysqli_store_result()</strong></span> this becomes particularly
    important.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 examples" id="refsect1-mysqli.store-result-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   See <span class="function"><a href="mysqli.multi-query.html" class="function">mysqli_multi_query()</a></span>.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mysqli.store-result-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="mysqli.real-query.html" class="function" rel="rdfs-seeAlso">mysqli_real_query()</a> - 执行一个mysql查询</span></li>
    <li class="member"><span class="function"><a href="mysqli.use-result.html" class="function" rel="rdfs-seeAlso">mysqli_use_result()</a> - Initiate a result set retrieval</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.stmt-init.html">mysqli::stmt_init</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.thread-id.html">mysqli::$thread_id</a></div>
 <div class="up"><a href="class.mysqli.html">MySQLi</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
